
create function dbo.sf_plazo( @p_noPlan int, @iddesarrollo varchar(10) )
returns int 
as
begin
	declare @retVal int
	if @p_noPlan = 0 begin 
		set @retVal = 0
	end else begin
		select	@retVal = plazo
		from	PLANESFINANCIAMIENTO
		where	iddesarrollo = @iddesarrollo and
			NoPlan = @p_noPlan
	end
	return  @retVal
end
